package com.company;

import java.util.ArrayList;
import java.util.Random;

public class Test3_ColorBall {
    public static void main(String[] args) {
        ArrayList<Integer> reBl=new ArrayList<>();
        int blBl=0;
        Random r=new Random();
        String reBls="";
        //1,记录不重复红球随机数
        for(int i=0;i<6;i++){
            int rd=r.nextInt(32)+1;
            if(!reBl.contains(rd)){
                reBl.add(rd);
            }
        }
        for(int i=0;i<6;i++){
            reBls=reBls+" "+reBl.get(i);
        }

        //2,记录蓝球随机数
        blBl=r.nextInt(15)+1;

        //3，打印
        System.out.println("双色球号码为");
        System.out.println("红球： "+reBls);
        System.out.println("蓝球： "+blBl);
    }
}
